﻿<div class="form-group" ng-controller="tutorController"> 
    <form class="form-horizontal" ng-submit="save()" ng-show="formVisibility">
        <div class="form-group">
            <label class="control-label col-xs-3">Nombre Tutor:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Nombre del Tutor o Apoderado" ng-model="tutor.Nombre">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Apellido Paterno:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Apellido Paterno" ng-model="tutor.Apellido_Paterno">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Apellido Materno:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Apellido Materno" ng-model="tutor.Apellido_Materno">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Direccion:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Direccion" ng-model="tutor.Direccion">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">DNI:</label>
            <div class="col-xs-9">
                <input type="number" class="form-control" placeholder="D N I" ng-model="tutor.tutorDni">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Telefono:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Telefono/cel." ng-model="tutor.Telefono">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">E-mail:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="E-mail/cel." ng-model="tutor.E_mail">
            </div>
        </div>
        <br>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <button type="button" class="btn btn-default" ng-click="cancel()">Cancel </button>
                <button class="btn btn-primary" type="submit">Save</button>
            </div>
        </div>

    </form>
    <h3>Lista de Tutores</h3>
    <div class="table-responsive">
        <table class="table table-striped tab-content table-bordered">
            <tr>
                <th>Nombre</th>
                <th>Apellido Paterno</th>
                <th>Apellido Materno</th>
                <th>Direccion</th>
                <th>DNI</th>
                <th>Telefono</th>
                <th>E-mail</th>
            </tr>
            <tr ng-repeat="d in tutores">

                <td> {{d.Nombre}}</td>
                <td> {{d.Apellido_Paterno}}</td>
                <td> {{d.Apellido_Materno}}</td>
                <td> {{d.Direccion}}</td>
                <td> {{d.tutorDni}}</td>
                <td> {{d.Telefono}} </td>
                <td> {{d.E_mail}} </td>
                <td>
                    <button ng-click="selec(d)" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> <span>Editar</span></button>
                    <button ng-click="delete(d.Tutor_Id)" type="button" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> <span>Eliminar</span></button>
                </td>

            </tr>
        </table>
    </div>
    <button ng-click="ShowForm()" ng-hide="formVisibility" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Agregar Tutor</button>
</div>